<template>
    <div>
        <div class="content">
            <div class="library-content-box">
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">全部</li>
                    </ul>
                    <div class="layui-tab-content"></div>
                </div>
                <div class="library-box">
                    <div class="library-content" v-for="item in Items">
                        <div class="library-content-child">
                            <div class="library-dec">
                                <div class="library-img">
                                    <img :src="item.picture">
                                </div>
                                <div class="library-dec-box">
                                    <p>{{ item.title }}</p>
                                </div>
                            </div>
                            <div class="library-down">
                                <div class="layui-btn-group">
                                    <a class="layui-btn layui-btn-small" href="javascript:;">
                                        <i class="layui-icon">&#xe601;</i> 下载</a>
                                    <a class="layui-btn layui-btn-small layui-btn-danger" v-on:click="DownItem(item.id)">
                                        <i class="layui-icon">&#xe705;</i> 阅读</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import request from '../link/request.js'
export default {
  name: 'Library',
  data () {
    return {
      Items: {}
    }
  },
  mounted () {
    this.getThisData()
  },
  methods: {
    getThisData () {
      let that = this
      request.get('/index.php/main/download/getDownList')
        .then(function (response) {
          console.log(response)
          that.Items = response
        })
    },
    toggle: function () {
    },
    DownItem (id, res) {
      this.redirect('download/item/' + id)
    }
  }
}
</script>

<style scoped>
    .content {
        width: 100%;
        height: auto;
        background-color: #f8f9fb;
        background-clip: padding-box;
        min-height: 28px;
        overflow: hidden;
    }
    .library-content-box {
        width: 1180px;
        height: auto;
        overflow: hidden;
        margin: 0 auto;
        min-width: 1120px;
        max-width: 1200px;
    }
    .library-box {
        width: 100%;
        height: auto;
        margin: 0 auto;
        overflow: hidden;
        margin-bottom: 65px;
    }
    .library-content {
        width: 25%;
        height: 225px;
        float: left;
        display: inline-block;
        vertical-align: middle;
        padding: 15px 10px;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    }
    .library-content .library-content-child{
        width:100%;
        height:100%;
        padding-top: 10px;
        background:#fff;
        box-shadow: 0 1px 2px rgba(150,150,150,0.3);
        -moz-box-shadow: 0 1px 2px rgba(150,150,150,0.3);
        -webkit-box-shadow: 0 1px 2px rgba(150,150,150,0.3);
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        border-radius: 4px;
    }
    .library-dec {
        width: 80%;
        height: 125px;
        margin: 5px auto;
    }
    .library-dec .library-dec-box {
        width: 90%;
        height: 52px;
        margin: 3px auto;
    }
    .library-dec .library-dec-box p {
        color: #666;
        line-height: 28px;
    }
    .library-dec .library-img {
        width: 80%;
        margin: 0 auto;
        height: 68px;
    }
    .library-dec .library-img img {
        width: 100%;
        height: 100%;
    }
    .library-down {
        text-align: center;
    }

</style>
